package com.css.zfzx.fwsjcj.modules.taskmanage.personfootprint.repository;

import com.css.zfzx.fwsjcj.modules.taskmanage.personfootprint.entity.FwPersonFootprintEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface FootPrintRepository extends JpaRepository<FwPersonFootprintEntity,String> {

    List<FwPersonFootprintEntity> findAllByUserIdAndTaskIdOrderByCreatTime(@Param("userId") String userId, @Param("taskId") String taskId);
    @Query(nativeQuery = true,value = "select * from fw_person_footprint where user_id=:userId and task_id=:taskId and creat_time>=:start and creat_time<=:end ORDER BY creat_time ASC")
    List<FwPersonFootprintEntity> findAllByUserIdAndTaskIdAndTimeOrderByCreatTime(@Param("userId") String userId, @Param("taskId") String taskId,@Param("start") String start, @Param("end") String end);
}
